package com.ruoyi.system.controller.front;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.GaAlarm;
import com.ruoyi.system.domain.GaPropaganda;
import com.ruoyi.system.domain.GaUser;
import com.ruoyi.system.dto.output.AlarmHistoryListGetOutput;
import com.ruoyi.system.enservice.IPropagandaEnService;
import com.ruoyi.system.service.IGaPropagandaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static java.util.stream.Collectors.toList;

@RestController
@RequestMapping("/front/propaganda")
public class PropagandaController extends BaseController {

    @Autowired
    private IGaPropagandaService propagandaService;

    @Autowired
    private IPropagandaEnService propagandaEnService;

    /**
     * 通过安全宣传编号查询安全宣传信息
     * @param propagandaId
     * @return
     */
    @GetMapping("/information/{propagandaId}")
    public AjaxResult getInformation(@PathVariable("propagandaId") Long propagandaId){
        return AjaxResult.success(propagandaEnService.getInformation(propagandaId));
    }

    /**
     * 查询所有安全信息
     * @author xuankai
     * @return 所有安全信息
     **/
    @GetMapping("/list")
    public AjaxResult getList() {
        startPage();
        List<GaPropaganda> list = propagandaService.selectGaPropagandaList(new GaPropaganda());
        return AjaxResult.success(list);
    }
}
